package org.example.proxy.dynamicProxy.jdk;

import org.example.proxy.staticProxy.Student;

import java.lang.reflect.Proxy;

public class TestJdk {
    public static void main(String[] args) {
        //创建被代理对象
        StudentJdk student = new StudentJdk();
        // 创建代理对象
        StudentService instance = (StudentService) Proxy.newProxyInstance(student.getClass().getClassLoader(), student.getClass().getInterfaces(), new JdkProxy(student));
        //执行代理方法
        instance.sendMsg("aaa");

    }
}
